function showmessage(id) {
	postedid = "posted_"+id;
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display='block';
		document.getElementById(postedid).style.display='block';
	}
	else {
		document.getElementById(id).style.display='none';
		document.getElementById(postedid).style.display='none';
	}
}

function doConfirm(url, type){
	if(confirm("Are you sure you want to delete this " + type + "?")){
		self.location = url;
	} else {
		return false;
	}	
}

function toggle(id) {
	imgid = "img_"+id;
	currsrc = document.getElementById(imgid).src;
	path = currsrc.substring(0,currsrc.lastIndexOf("/"));
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display='block';

		imgpath = path+"/expanded.png";
		document.getElementById(imgid).src = imgpath;
	}
	else {
		document.getElementById(id).style.display='none';
		imgpath = path+"/collapsed.png";
		document.getElementById(imgid).src = imgpath;
	}
}


function updateMenu(id){
	imgid = "img_"+id;
	currsrc = document.getElementById(imgid).src;
	path = currsrc.substring(0,currsrc.lastIndexOf("/"));
	imgpath = path+"/expanded.png";	
	
	document.getElementById(id).style.display='block';
	document.getElementById(imgid).src = imgpath;
}

function easteregg(element) {
    var header = document.getElementById('eastereggheader');
    if (header)
    return;

    header = document.createElement("h2");
    header.id = 'eastereggheader';
    header.appendChild(document.createTextNode('Your development team'));
    element.appendChild(header);

    var imagePath = "#springUrl('/images/')";
    var developers = new Array("espen", "chris", "christopher", "eszter", "rolf", "barna");
    for (var i = 0; i < developers.length; i++) {
    var image = document.createElement("img");
    image.style.border = "solid 1px #999999";
    image.setAttribute("alt",developers[i]);
    var space = document.createElement("span");
    space.innerHTML = "&nbsp;";
    image.src = imagePath + developers[i] + ".jpg";
    element.appendChild(image);
    element.appendChild(space);
    }
}
